Reapply changes to support rich integration tests for fastly compute#589
Open
dpetrick wants to merge 6 commits intofastly:mainfrom
Open
Reapply changes to support rich integration tests for fastly compute#589dpetrick wants to merge 6 commits intofastly:mainfrom
dpetrick wants to merge 6 commits intofastly:mainfrom
Conversation
…nitoring for integration testing.
… fresh ExecuteCtxBuilder reusing the already-compiled Wasm engine and instance_pre. Unlike fork() (which copies existing config), this starts with all-default configuration (empty backends, dictionaries, etc.) so the caller can set everything up from scratch. It also spawns its own epoch increment thread. src/lib.rs — Re-exports ObjectKey and ObjectStoreKey from the object_store module, making them part of the public API. src/session.rs — Changes endpoint monitor lookup from blocking_read() to try_read() on the RwLock, avoiding potential deadlocks if the lock is already held. Falls through silently if the lock can't be acquired.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR extends Viceroy's public API to support richer integration testing by introducing several new capabilities or extending existing ones:
InMemoryBackendHandlertrait +Handlerwrapper): Backends can now be configured with custom async handlers that intercept requests and return responses without making real HTTP calls, enabling fully in-process integration tests.DynamicBackendRegistrationInterceptortrait): Allows test harnesses to hook into dynamic backend registration and modify or augment backends as they are registered at runtime (e.g., to attach in-memory handlers).Cacheand related structs to allow pretty printing. This is useful for debugging potentially incorrect cache state that the application produces.Cachewithpurge_allconvenience method.GuestHandle+run_to_completion(): Thehandle_requestandspawn_guestcall chains now return aGuestHandleso callers can await full guest completion (including async logging, cache writes, etc.) after receiving the HTTP response.EndpointsMonitor/EndpointListener): Provides a channel-based mechanism to register listeners on named logging endpoints, allowing tests to capture and assert on log output from the guest.ExecuteCtx::fork(): Allows creating a lightweight fork of an execution context that shares the compiled WASM engine/module but has fresh per-test state (cache, request IDs, pending reuse), making it efficient to run many tests against the same compiled guest.